package com.puman.beautyfarmcounselor.ui.core;

import android.content.Context;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.inputmethod.InputMethodManager;
import android.widget.ImageView;
import android.widget.TextView;
import com.puman.beautyfarmcounselor.R;

import com.puman.beautyfarmcounselor.MainActivity;
import com.puman.beautyfarmcounselor.R;


/**
 * A placeholder fragment containing a simple view.
 */
public class BaseFragment extends Fragment {


    public  View mView;
    public TextView topTitle;
    public ImageView backBtn;

    public BaseFragment() {
    }



//    @Override
//    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
//        mView = inflater.inflate(R.layout.fragment_base, container, false);
//        topTitle = (TextView) mView.findViewById(R.id.base_title);
//        backBtn = (ImageView) mView.findViewById(R.id.back_btn);
//        backBtn.setOnClickListener(new View.OnClickListener() {
//            @Override
//            public void onClick(View v) {
//                MainActivity.getInstace().getFragmentManager().popBackStack();
//            }
//        });
//        return mView ;
//    }





    /**
     * 回收键盘
     *
     * @param view 点击控件
     */
    protected void keyboardTakeBack(View view) {
        InputMethodManager imm = (InputMethodManager) view.getContext()
                .getSystemService(Context.INPUT_METHOD_SERVICE);
        if (imm.isActive()) {
            imm.hideSoftInputFromWindow(view.getApplicationWindowToken(), 0);
        }
        if (imm.isActive()) {
            imm.hideSoftInputFromWindow(view.getApplicationWindowToken(), 0);
        }
    }
}
